package com.xiaoq.social.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.xiaoq.social.entity.FavoriteEntity;
import com.xiaoq.social.repository.IFavoriteRepository;
import com.xiaoq.social.service.IFavoriteService;
import com.xiaoq.vo.PagingVo;
@Component
public class FavoriteServiceImpl implements IFavoriteService {
	
	@Autowired
	private IFavoriteRepository favoriteRep;

	@Override
	public boolean isFavorite(String userId, String tgtId) {
		
		return favoriteRep.isFavorite(userId, tgtId);
	}

	@Override
	public boolean addFavorite(FavoriteEntity favorite) {
		
		return favoriteRep.addFavorite(favorite);
	}

	@Override
	public boolean delFavorite(String userId, String tgtId) {
		
		return favoriteRep.delFavorite(userId, tgtId);
	}

	@Override
	public List<FavoriteEntity> findFavoriteList(String userId, PagingVo pvo) {
		
		return favoriteRep.findFavoriteList(userId, pvo);
	}

	@Override
	public boolean delFavoriteByTgtId(String tgtId) {
		return favoriteRep.delFavoriteByTgtId(tgtId);
	}

}
